package com.example.androidsx;

import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.TextView;
import androidx.appcompat.app.AppCompatActivity;

public class PaymentSuccessActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_payment_success);

        // 接收订单信息
        Intent intent = getIntent();
        String paymentMethod = intent.getStringExtra("payment_method");
        String amount = intent.getStringExtra("amount");

        // 显示订单信息
        TextView tvOrderInfo = findViewById(R.id.tvOrderInfo);
        tvOrderInfo.setText(String.format(
                "支付方式: %s\n支付金额: %s\n\n感谢您的购买！",
                paymentMethod,
                amount
        ));

        // 返回首页按钮
        Button btnBackToHome = findViewById(R.id.btnBackToHome);
        btnBackToHome.setOnClickListener(v -> {
            // 可根据需要返回到特定页面
            finish();
        });
    }
}